# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib.auth.models import AbstractUser
from django.db import models

from django.db import connection
from django.db.models import Count
from datetime import datetime


from django.utils.timezone import now, timedelta




class Admin(AbstractUser):
    qq = models.CharField(max_length=15, null=True)
    phone = models.IntegerField(default=0,null=True)
    email = models.CharField(max_length=20, null=True)



class Client(models.Model): #客户表
    gender_type = (
        ("0", "女"), ("1", "男")
    )
    client_username = models.CharField(max_length=20, null=True)
    client_password = models.CharField(max_length=50, null=True)
    money = models.IntegerField(default=0,null=True)
    times = models.DateTimeField(auto_now=True)
    gender = models.CharField(max_length=3, choices=gender_type, default="0", verbose_name="性别")
    email = models.CharField(max_length=25, null=True)
    phone = models.CharField(max_length=20, null=True)
    qq_number = models.CharField(max_length=25, null=True)



class Personnel_type(models.Model):
    types = (
        ("0", "理发师"), ("1", "洗发师")
    )
    username = models.ForeignKey("Personnel", related_name='personnel_user', null=True)
    personneltype = models.CharField(max_length=3, choices=types, default="0", verbose_name="员工类别")





class Personnel(models.Model): #员工表
    gender_type = (
        ("0", "女"), ("1", "男")
    )
    gender = models.CharField(max_length=3, choices=gender_type, default="0", verbose_name="性别")
    age = models.CharField(max_length=20, null=True)
    username = models.CharField(max_length=20, null=True)
    base_salary = models.IntegerField(null=True)
    wage = models.IntegerField(default=0, null=True)
    commission = models.IntegerField(default=0, null=True)
    phone = models.CharField(max_length=15, null=True)
    email = models.CharField(max_length=15, null=True)
    qqnumber = models.CharField(max_length=20, null=True)
    native_place = models.CharField(max_length=20, null=True)

















